package org.metasketch.ham.diagrams.units;

import javafx.scene.paint.Color;
import javafx.scene.shape.Arc;
import javafx.scene.shape.ArcTo;
import javafx.scene.shape.Circle;
import javafx.scene.shape.ClosePath;
import javafx.scene.shape.HLineTo;
import javafx.scene.shape.Line;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.QuadCurve;
import javafx.scene.shape.QuadCurveTo;
import javafx.scene.shape.Rectangle;

public class RoleNode extends ParticipationUnitNode {

	public RoleNode() {
		Rectangle rect = new Rectangle(0, 0, width, height);
		rect.setFill(Color.TRANSPARENT);

		Path head = new Path();
		head.getElements()
				.addAll(new MoveTo(0, 0),
						new HLineTo(width),
						new QuadCurveTo(width, width - width * 0.25,
								width * 0.5, width),
						new QuadCurveTo(0, width - width * 0.25, 0, 0),
						new ClosePath());
		head.setStroke(Color.BLACK);
		head.setFill(Color.WHITE);
		head.setStrokeWidth(1);
		//
		// QuadCurveTo quadCurve = new QuadCurveTo();
		// // quadCurve.setStartX(0);
		// // quadCurve.setStartY(0);
		// quadCurve.setControlX(0);
		// quadCurve.setControlY(30);
		// quadCurve.setEndX(20);
		// quadCurve.setEndY(40);
		// quadCurve.setStroke(Color.BLACK);
		// quadCurve.setFill(Color.WHITE);
		// quadCurve.setStrokeWidth(1);

		Line arms = new Line(-width * 0.25, width, width + width * 0.25, width);

		Line leftLeg = new Line(0, height, width * 0.5, width);
		Line rightLeg = new Line(width, height, width * 0.5, width);

		getChildren().addAll(rect, head, arms, leftLeg, rightLeg);
	}

}
